@extends('Admin.index')

@section('css')
    <style>
        a {
            color: #337ab7;
        }
    </style>

@endsection

@section('content')

    <div class="app-third-sidebar">
        <nav class="ui-nav " style="display: block;">
            <ul>
                <li>
                    <a href="javascript:void(0);"><span>兑换记录</span></a>
                </li>
            </ul>
            <div class="top-back">
                <button class="btn btn-default layer-go-back" role="button">返回</button>
            </div>
        </nav>
    </div>

    <div id="wrapper">

        <form class="form-inline" id="search-form" onsubmit="return false;">
            <input type="hidden" name="id" value="{{$data}}">
        </form>
        <div class="row">
            <div class="col-lg-12">
                <table id="table"></table>
            </div>
        </div>
    </div>

@endsection

@section('js')

    <script>

        var bootstrap_table_ajax_url = '/admin/statistics/exchange/search';

        $('#table').bootstrapTable({
            classes: 'table table-hover', //bootstrap的表格样式
            sidePagination: 'server', //获取数据方式【从服务器获取数据】
            pagination: true, //分页
            height: $(window).height() - 200, //表格高度
            pageNumber: 1, //页码【第X页】
            pageSize: 10, //每页显示多少条数据
            queryParamsType: 'limit',
            queryParams: function (params) {
                var dt = E.getFormValues('search-form');
                console.log(dt);
                $.extend(params, dt);
                return params;
            },
            url: bootstrap_table_ajax_url,//ajax链接
            sortName: 'dtModifyTime', //排序字段
            sortOrder: 'DESC',//排序方式
            columns: [ //字段
                { title: '序号', field: 'id', align: 'center'},
                { title: '操作时间', field: 'dtModifyTime', align: 'center'},
                { title: '兑换人', field: 'user_name', align: 'center'},
                { title: '金币数', field: 'iExGold', align: 'center'}
            ]
        });

    </script>

@endsection

